package com.woniuxy.caradmin.service.impl;

import com.woniuxy.caradmin.entity.pojo.Troublerecord;

import com.woniuxy.caradmin.entity.vo.TroublerecordVo;
import com.woniuxy.caradmin.mapper.TroublerecordMapper;
import com.woniuxy.caradmin.service.TroublerecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author womenzu
 * @since 2020-12-07
 */
@Service
public class TroublerecordServiceImpl implements TroublerecordService {
@Autowired
private TroublerecordMapper troublerecordMapper;

    @Override
    public List<Troublerecord> selectAllByPage(TroublerecordVo troublerecordVo) {
        return troublerecordMapper.selectAllByPage(troublerecordVo);
    }

    @Override
    public int addTroublerecord(Troublerecord troublerecord) {
        return  troublerecordMapper.addTroublerecord(troublerecord);
    }

    @Override
    public int updateTroublerecord(Troublerecord troublerecord) {
        return troublerecordMapper.updateTroublerecord(troublerecord);
    }

    @Override
    public boolean removeT(Integer []ids) {
        if (ids != null && ids.length > 0 ){
            for (Integer id :ids){
                troublerecordMapper.removeT(id);
            }
            return true;
        }
        return false;
    }

    @Override
    public Troublerecord selecTroubleById(Integer id) {
        return troublerecordMapper.selecTroubleById(id);
    }
}
